<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../static/bootstrap/css/bootstrap.min.css"
	rel="stylesheet">
<link rel="stylesheet" href="../../static/css/sb-admin-2.css">
<link href="../../static/prettify/github-v2.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="../../static/js/html5shiv.min.js"></script>
      <script src="../../static/js/respond.min.js"></script>
    <![endif]-->
<style>
body {
	word-wrap: break-word;
}
</style>
</head>
<body onload="prettyPrint();">
	<div id="nav"></div>
	<div id="page-wrapper" style="padding: 10px">
		<div class="container-fluid">
			<div class="row">
				<div class="col-md-12">
					<ol class="breadcrumb">
						<li><a href="../tag.html">标签</a></li>
						<li><a href="index.html">数据标签</a></li>
						<li><a href="articles.html">文章列表标签</a></li>
					</ol>
					<h2>文章列表标签</h2>
					<h3>默认dataName</h3>
					<p>articlePage</p>
					<h3>可接受的标签属性</h3>
					<div class="table-responsive">
						<table class="table">
							<thead>
								<tr>
									<th>属性名</th>
									<th class="col-md-3">类型</th>
									<th>是否必须</th>
									<th>默认</th>
									<th class="col-md-6">说明</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>begin</td>
									<td>日期(关于可以接受的日期格式，请见<a
										href="../appendix.html#accpet-datetime" target="_blank">接受的日期格式</a>)
									</td>
									<td>否</td>
									<td></td>
									<td>文章撰写日期最小值<b>必须和end属性结合使用</b></td>
								</tr>
								<tr>
									<td>end</td>
									<td>日期(关于可以接受的日期格式，请见<a
										href="../appendix.html#accpet-datetime" target="_blank">接受的日期格式</a>)
									</td>
									<td>否</td>
									<td></td>
									<td>文章撰写日期最大值<b>必须和begin属性结合使用</b></td>
								</tr>
								<tr>
									<td>query</td>
									<td>String(最长为40个字符)</td>
									<td>否</td>
									<td></td>
									<td>查询内容，接受lucene默认的MultiFieldQueryParser的语法</td>
								</tr>
								<tr>
									<td>from</td>
									<td>ORIGINAL|COPIED</td>
									<td>否</td>
									<td></td>
									<td>文章来源</td>
								</tr>
								<tr>
									<td>tag</td>
									<td>String</td>
									<td>否</td>
									<td></td>
									<td>文章标签，<b>只接受一个标签，如果需要多个，请使用query属性</b></td>
								</tr>
								<tr>
									<td>sort</td>
									<td>HITS|PUBDATE|LASTMODIFYDATE</td>
									<td>否</td>
									<td></td>
									<td>文章排序方式</td>
								</tr>
								<tr>
									<td>currentPage</td>
									<td>int</td>
									<td>否</td>
									<td>1</td>
									<td>当前查询页码</td>
								</tr>
								<tr>
									<td>pageSize</td>
									<td>int</td>
									<td>否</td>
									<td>10</td>
									<td>每页展示数目<b>这个数目不会超过设置的最大每页数目</b></td>
								</tr>
								<tr>
									<td>ignoreLevel</td>
									<td>boolean</td>
									<td>否</td>
									<td>false</td>
									<td>查询时候是否忽略文章置顶级别</td>
								</tr>
								<tr>
									<td>queryLock</td>
									<td>boolean</td>
									<td>否</td>
									<td>true</td>
									<td>是否同时查询被锁保护的文章，如果为false，只会查询没有被锁保护的文章</td>
								</tr>
								<tr>
									<td>highlight</td>
									<td>boolean</td>
									<td>否</td>
									<td>true</td>
									<td>是否高亮显示查询匹配结果</td>
								</tr>
								<tr>
									<td>ignorePaging</td>
									<td>boolean</td>
									<td>否</td>
									<td>false</td>
									<td>是否忽略分页</td>
								</tr>
								<tr>
									<td colspan="5"><b><i>以下属性仅在以管理员身份查询时生效</i></b></td>
								</tr>
								<tr>
									<td>queryPrivate</td>
									<td>boolean</td>
									<td>否</td>
									<td>false</td>
									<td>是否查询私人文章</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3>结果返回</h3>
					<p>
						无论是否查询到结果，都将会返回一个不为null的PageResult&lt;Article&gt;对象，该对象基础可访问属性请见<a
							href="../appendix.html#pageresult-pros" target="_blank">PageResult默认属性</a>，
					</p>
					<p>Article可访问属性如下：</p>
					<div class="table-responsive">
						<table class="table">
							<thead>
								<tr>
									<th>属性名</th>
									<th class="col-md-3">类型</th>
									<th>是否可能为null</th>
									<th class="col-md-6">说明</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>id</td>
									<td>Integer</td>
									<td>否</td>
									<td>文章ID</td>
								</tr>
								<tr>
									<td>pubDate</td>
									<td>java.sql.Timestamp</td>
									<td>否</td>
									<td>文章发布日期</td>
								</tr>
								<tr>
									<td>lastModifyDate</td>
									<td>java.sql.Timestamp</td>
									<td>是</td>
									<td>文章最后修改日期</td>
								</tr>
								<tr>
									<td>title</td>
									<td>String</td>
									<td>否</td>
									<td>文章标题</td>
								</tr>
								<tr>
									<td>summary</td>
									<td>String</td>
									<td>否</td>
									<td>文章摘要</td>
								</tr>
								<tr>
									<td>isPrivate</td>
									<td>Boolean</td>
									<td>否</td>
									<td>是否是私人文章</td>
								</tr>
								<tr>
									<td>hits</td>
									<td>int</td>
									<td>否</td>
									<td>文章点击数</td>
								</tr>
								<tr>
									<td>comments</td>
									<td>int</td>
									<td>否</td>
									<td>文章评论数</td>
								</tr>
								<tr>
									<td>level</td>
									<td>Integer</td>
									<td>是</td>
									<td>文章置顶级别，如果没有设置，则为null</td>
								</tr>
								<tr>
									<td>editor</td>
									<td>enum</td>
									<td>否</td>
									<td>文章编辑器类型HTML(富文本),MD(markdown)</td>
								</tr>
								<tr>
									<td>from</td>
									<td>enum</td>
									<td>否</td>
									<td>文章来源ORIGINAL(原创),COPIED(转载)</td>
								</tr>
								<tr>
									<td>space</td>
									<td>Space</td>
									<td>否</td>
									<td>空间，<a data-toggle="modal" data-target="#spaceModal"
										href="###">查看可供访问属性</a></td>
								</tr>
								<tr>
									<td>lockId</td>
									<td>String</td>
									<td>是</td>
									<td>锁ID，如果文章没有被锁保护，则为null</td>
								</tr>
								<tr>
									<td>alias</td>
									<td>String</td>
									<td>是</td>
									<td>文章别名，如果没有设置，则为null</td>
								</tr>
								<tr>
									<td>tags</td>
									<td>Set&lt;Tag&gt;</td>
									<td>否</td>
									<td>文章标签，如果没有标签，则为空集合，<a data-toggle="modal"
										data-target="#tagModal" href="###">查看标签可供访问属性</a></td>
								</tr>
							</tbody>
						</table>
					</div>
					<p>Article可调用的方法如下：</p>
					<div class="table-responsive">
						<table class="table">
							<thead>
								<tr>
									<th>方法名</th>
									<th class="col-md-3">接收参数</th>
									<th>返回结果</th>
									<th class="col-md-6">说明</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>isPrivate</td>
									<td></td>
									<td>boolean</td>
									<td>判断文章是否是私有的，如果空间是私有的，那么文章始终是私有的</td>
								</tr>
								<tr>
									<td>getTagStr</td>
									<td></td>
									<td>boolean</td>
									<td>将文章的标签转化为字符串,用','号拼接，如果没有标签，返回空字符串</td>
								</tr>
								<tr>
									<td>hasLock</td>
									<td></td>
									<td>boolean</td>
									<td>判断文章是否被锁保护，如果空间被锁保护，那么文章始终被锁保护</td>
								</tr>
								<tr>
									<td>hasTag</td>
									<td>string</td>
									<td>boolean</td>
									<td>判断文章是否拥有指定标签<b>忽略标签大小写</b></td>
								</tr>
								<tr>
									<td>getTag</td>
									<td>string</td>
									<td>Optional&lt;Tag&gt;</td>
									<td>获取文章某个标签，返回结果必须用Optional.isPresent()来判断是否存在，<a
										data-toggle="modal" data-target="#tagModal" href="###">查看标签可供访问属性</a></td>
								</tr>
							</tbody>
						</table>
					</div>

					<h3>注意</h3>
					<div class="alert alert-warning">
						<p>如果查询参数中query不为空，那么有匹配结果时将会被高亮显示，此时：</p>
						<ul>
							<li>如果title被匹配，那么title部分内容将会被html标签包裹，例如：
								原标题：简单的spring发送邮件以及异常邮件通知，如果query为spring，那么spring将会被高亮，title将会变为
								简单的&lt;b
								class="lucene-highlight-title"&gt;spring&lt;/b&gt;发送邮件以及异常邮件通知,此时应该输出html格式的内容,例如：th:utext="&#36;{article.title}"</li>
							<li>
								如果tag被匹配，那么被匹配的tag将会被html标签包裹，例如某文章拥有html,spring,mybatis三个标签，如果通过query=spring查询,那么将会返回html，&lt;b
								class="lucene-highlight-title"&gt;spring&lt;/b&gt;,mybatis三个标签</li>
							<li><b>summary有可能不是你设置的summary</b>，如果summary没有匹配到而文章内容匹配，那么summary将会是文章内容中的匹配片段，如果summary匹配到或者summary和内容都没有匹配到，
								那么summary不会改变，summary和title相同，被匹配到时需要用输出html内容来显示高亮结果</li>
						</ul>

					</div>

					<h3>默认配合模板</h3>
					<pre class="prettyprint lang-html">&lt;ul class=&quot;nav nav-tabs&quot; role=&quot;tablist&quot; style=&quot;margin-bottom: 10px&quot;
	th:if=&quot;&#36;{showSortLab == null ? true : showSortLab}&quot;&gt;
	&lt;li role=&quot;presentation&quot;
		th:attr=&quot;class=&#36;{articlePage.param.sort == null ? &#x27;active&#x27; : null}&quot;&gt;&lt;a
		th:href=&quot;&#36;{urls.getArticlesUrl(articlePage.param,null)}&quot;&gt;默认&lt;/a&gt;&lt;/li&gt;
	&lt;li role=&quot;presentation&quot;
		th:attr=&quot;class=&#36;{(articlePage.param.sort != null &amp;&amp; articlePage.param.sort.name() == &#x27;PUBDATE&#x27;) ? &#x27;active&#x27; : null}&quot;&gt;&lt;a
		th:href=&quot;&#36;{urls.getArticlesUrl(articlePage.param,&#x27;PUBDATE&#x27;)}&quot;
		th:if=&quot;&#36;{articlePage.param.hasQuery()}&quot;&gt;发布时间&lt;/a&gt;&lt;/li&gt;
	&lt;li role=&quot;presentation&quot;
		th:attr=&quot;class=&#36;{(articlePage.param.sort != null &amp;&amp; articlePage.param.sort.name() == &#x27;LASTMODIFYDATE&#x27;) ? &#x27;active&#x27; : null}&quot;&gt;&lt;a
		th:href=&quot;&#36;{urls.getArticlesUrl(articlePage.param,&#x27;LASTMODIFYDATE&#x27;)}&quot;&gt;最近更新&lt;/a&gt;&lt;/li&gt;
	&lt;li role=&quot;presentation&quot;
		th:attr=&quot;class=&#36;{(articlePage.param.sort != null &amp;&amp; articlePage.param.sort.name() == &#x27;HITS&#x27;) ? &#x27;active&#x27; : null}&quot;&gt;&lt;a
		th:href=&quot;&#36;{urls.getArticlesUrl(articlePage.param,&#x27;HITS&#x27;)}&quot;&gt;点击量&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div th:if=&quot;&#36;{#lists.isEmpty(articlePage.datas)}&quot;&gt;
	&lt;div class=&quot;alert alert-info&quot;&gt;当前没有任何文章&lt;/div&gt;
&lt;/div&gt;
&lt;div th:unless=&quot;&#36;{#lists.isEmpty(articlePage.datas)}&quot;&gt;
	&lt;div class=&quot;well&quot; th:each=&quot;article : &#36;{articlePage.datas}&quot;&gt;
		&lt;h4&gt;
			&lt;span th:if=&quot;&#36;{article.hasLock()}&quot; class=&quot;glyphicon glyphicon-lock&quot;
				style=&quot;margin-right: 5px&quot;&gt;&lt;/span&gt;&lt;span
				th:if=&quot;&#36;{article.level != null}&quot;&gt;【置顶】&lt;/span&gt; &lt;span
				th:if=&quot;&#36;{space == null}&quot;&gt;&lt;a
				th:href=&quot;&#36;{urls.getUrl(article.space)}&quot;
				th:text=&quot;&#x27;【&#x27;+&#36;{article.space.name}+&#x27;】&#x27;&quot;&gt;&lt;/a&gt;&lt;/span&gt; &lt;a
				th:href=&quot;&#36;{urls.getUrl(article)}&quot; th:utext=&quot;&#36;{article.title}&quot;&gt; &lt;/a&gt;
		&lt;/h4&gt;
		&lt;div style=&quot;margin-top: 5px; margin-bottom: 10px&quot;
			th:unless=&quot;&#36;{#lists.isEmpty(article.tags)}&quot;&gt;
			&lt;span class=&quot;glyphicon glyphicon-tag&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span
				th:each=&quot;tag : &#36;{article.tags}&quot; style=&quot;margin-right: 10px&quot;&gt; &lt;a
				th:href=&quot; &#36;{urls.getArticlesUrl(tag)}&quot; th:utext=&quot; &#36;{tag.name}&quot;&gt;&lt;/a&gt;
			&lt;/span&gt;
		&lt;/div&gt;
		&lt;div style=&quot;margin-top: 5px; margin-bottom: 10px&quot;&gt;
			 &lt;span
				th:text=&quot;&#x27;发布日期：&#x27;+&#36;{messages.getMessage(timeDiffParser.parseDiff(article.pubDate))}&quot;&gt;&lt;/span&gt;
			&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span
				th:if=&quot;&#36;{article.lastModifyDate != null}&quot;
				th:text=&quot;&#x27;最近更新：&#x27;+&#36;{messages.getMessage(timeDiffParser.parseDiff(article.lastModifyDate))}&quot;&gt;&lt;/span&gt;
		&lt;/div&gt;

		&lt;div style=&quot;margin-top: 5px; margin-bottom: 10px&quot;&gt;
			&lt;span aria-hidden=&quot;true&quot; class=&quot;glyphicon glyphicon-fire&quot;
				title=&quot;点击次数&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;span th:text=&quot;&#36;{article.hits}&quot;&gt; &lt;/span&gt;
			  &lt;span class=&quot;glyphicon glyphicon-comment&quot; title=&quot;评论数&quot;
				aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;span th:text=&quot;&#36;{article.comments}&quot;&gt; &lt;/span&gt;
		&lt;/div&gt;

		&lt;div th:utext=&quot;&#36;{article.summary}&quot;
			th:unless=&quot;&#36;{article.hasLock() &amp;&amp; user == null}&quot;&gt;&lt;/div&gt;
		&lt;div th:if=&quot;&#36;{article.hasLock() &amp;&amp; user == null}&quot;&gt;
			&lt;strong th:text=&quot;&#36;{messages.getMessage(&#x27;article.locked&#x27;,&#x27;文章受锁保护&#x27;)}&quot;&gt;&lt;/strong&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;

&lt;div th:if=&quot;&#36;{articlePage.totalPage &gt; 1}&quot;&gt;
	&lt;ul class=&quot;pagination&quot;&gt;
		&lt;li
			th:each=&quot; i : &#36;{#numbers.sequence(articlePage.listbegin, articlePage.listend-1)}&quot;
			th:class=&quot;&#36;{(i == articlePage.currentPage) ? &#x27;active&#x27; : &#x27;&#x27;}&quot;&gt;&lt;a
			th:href=&quot;&#36;{urls.getArticlesUrl(articlePage.param,i)}&quot; th:text=&quot;&#36;{i}&quot;&gt;&lt;/a&gt;
	&lt;/ul&gt;
&lt;/div&gt;
					</pre>

				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="spaceModal" tabindex="-1" role="dialog"
		aria-labelledby="spaceModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="spaceModalLabel">空间属性</h4>
				</div>
				<div class="modal-body">

					<div class="table-responsive">
						<table class="table">
							<thead>
								<tr>
									<th>属性名</th>
									<th class="col-md-3">类型</th>
									<th>是否可能为null</th>
									<th class="col-md-4">说明</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>id</td>
									<td>Integer</td>
									<td>否</td>
									<td>空间ID</td>
								</tr>
								<tr>
									<td>alias</td>
									<td>String</td>
									<td>否</td>
									<td>空间别名</td>
								</tr>
								<tr>
									<td>name</td>
									<td>String</td>
									<td>否</td>
									<td>空间名称</td>
								</tr>
								<tr>
									<td>isPrivate</td>
									<td>Boolean</td>
									<td>否</td>
									<td>是否是私人空间</td>
								</tr>
								<tr>
									<td>lockId</td>
									<td>String</td>
									<td>是</td>
									<td>锁ID，如果空间没有被锁保护，则为null</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>

	<div class="modal fade" id="tagModal" tabindex="-1" role="dialog"
		aria-labelledby="tagModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="tagModalLabel">空间属性</h4>
				</div>
				<div class="modal-body">
					<div class="table-responsive">
						<table class="table">
							<thead>
								<tr>
									<th>属性名</th>
									<th class="col-md-3">类型</th>
									<th>是否可能为null</th>
									<th class="col-md-4">说明</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>name</td>
									<td>String</td>
									<td>否</td>
									<td>标签名</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</body>

<script type="text/javascript" src="../../static/jquery/jquery.min.js"></script>
<script type="text/javascript"
	src="../../static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../static/prettify/prettify.js"></script>
<script>
	$(function() {
		$("#nav").load("dataTagNav.html");
	});
</script>
</html>
